package branch;

public class ifDemo {
    public static void main(String[] args)
    {
       test1();

    }

    public static void test1()
    {
        boolean red = true;
        boolean yellow = false;
        boolean green = false;
       if(red)
       {
           System.out.println("红灯亮，停止");

       }
       else if(yellow)
       {
           System.out.println("黄灯亮，注意");

       }
       else if(green)
       {
           System.out.println("绿灯亮，开始");
       }
       else
       {
           System.out.println("灯泡故障");
       }
    }

}
